﻿@model Inscriptionem.Areas.Inscriptionem.Models.Views.TagCollectionViewModel

@{
    ViewBag.Title = "Inscriptionem » Tags";
    Layout = "../Shared/Layout.cshtml";

    ViewBag.CurrentPage = "Tags";

    int currentPage = Model.Page + 1;
    int totalPages = (Model.Tags.Count() / 25) + 1;
}

<div class="outer" id="contentwrap">
    @{Html.RenderPartial("NavigationMenu");}
    <div class="postcont">
		<div id="content">
            <div class="post type-post status-publish format-standard hentry">
                <h2 class="title">Tags</h2>
                <div style="float: right; margin-top: -25px;">
                    <form action="/Inscriptionem/Tag/Search" method="post">
                        <input type="text" name="Text" />
                        <input type="hidden" name="Page" value="0" />
                        <input type="submit" value="Search" />
                    </form>
                </div>
                <div class="postdate-single error-message"></div>
                <table width="100%">
                    <thead>
                        <tr class="postdate">
                            <td>Tag</td>
                            <td>Language</td>
                            <td>Language Name</td>
                            <td style="width: 60px;"></td>
                            <td style="width: 60px;"></td>
                        </tr>
                    </thead>
                    <tbody>
                    @foreach (var tag in Model.Tags.Skip(25 * Model.Page).Take(25))
                    {
                    <text>
                    <tr>
                        <td>@tag.Name</td>
                        <td>@tag.Language.Name</td>
                        <td>@tag.Language.LocalizedName</td>
                        <td>
                            <form method="post" action="/Inscriptionem/Tag/Edit">
                                <input type="hidden" name="ID" value="@tag.ID" />
                                <input type="submit" value="Edit" />
                            </form>
                        </td>
                        <td>
                            <form method="post" action="/Inscriptionem/Tag/Delete">
                                <input type="hidden" name="ID" value="@tag.ID" />
                                <input type="submit" value="Delete" />
                            </form>
                        </td>
                    </tr>
                    </text>
                    }
                    <td><a href="/Inscriptionem/Tag/Add">Add</a></td>
                    </tbody>
                </table>
			</div>
            <div class="navigation">
            @{Html.RenderAction("Pagination",
                    new Inscriptionem.Models.Menu.Requests.PaginationRequestModel() {
                        Language = "English",
                        Section = "",
                        CurrentPage = currentPage,
                        TotalPages = totalPages,
                        MaximumLinkCount = 7,
                        UrlTemplate = "/Inscriptionem/Tag/Page/{ID}"
                        });
            }
			</div>
        </div>
	</div>	
</div>
